Shim extension for containerd
Rust crate to ease runtime v2 shim implementation.
It replicates same shim.Run API offered by containerd's shim v2 runtime implementation written in Go.
Look and feel
The API is very similar to the one offered by Go version:
How to use with containerd
Note: All operations are in the root directory of rust-extensions
.
With shim v2 runtime:
Or if on 1.6+
Or manually:
$ touch log
# Run containerd in background
$ sudo TTRPC_ADDRESS="/var/run/containerd/containerd.sock.ttrpc" \
cargo run --example skeleton -- \
-namespace default \
-id 1234 \
-address /var/run/containerd/containerd.sock \
-publish-binary ./bin/containerd \
start
unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
$ cargo build --example shim-proto-connect
$ sudo ./target/debug/examples/shim-proto-connect unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock
Connecting to unix:///var/run/containerd/eb8e7d1c48c2a1ec.sock...
Sending `Connect` request...
Connect response: version: "example"
Sending `Shutdown` request...
Shutdown response: ""
$ cat log
[INFO] server listen started
[INFO] server started
[INFO] Shim successfully started, waiting for exit signal...
[INFO] Connect request
[INFO] Shutdown request
[INFO] Shutting down shim instance
[INFO] close monitor
[INFO] listener shutdown for quit flag
[INFO] ttrpc server listener stopped
[INFO] listener thread stopped
[INFO] begin to shutdown connection
[INFO] connections closed
[INFO] reaper thread exited
[INFO] reaper thread stopped
Supported Platforms
Currently, following OSs and hardware architectures are supported, and more efforts are needed to enable and validate other OSs and architectures.
- Linux
- Mac OS